#include <stdio.h>

//求最大值
#define MAX(n1,n2,n3)  (n1>n2?n1:n2)>n3?(n1>n2?n1:n2):n3

static float ImbNgA_count(float IA,float IB,float IC)
{
    static float ImbNgA=0;

    float average = (IA+IB+IC)/3;  //平均值
    if(IA>=average)  IA -= average;
    else    IA = average-IA;

    if(IB>=average)  IB -= average;
    else    IB = average-IB;
    
    if(IC>=average)  IC -= average;
    else    IC = average-IC;
    
    return ImbNgA = MAX(IA,IB,IC)/average;
}

int main(int argc, char const *argv[])
{
    printf("%f",ImbNgA_count(6,8,6));
    return 0;
}
